package com.idak.rdv.db;

// Generated 26 mai 2012 12:18:07 by Hibernate Tools 3.4.0.CR1

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * UserRole generated by hbm2java
 */
@SuppressWarnings("serial")
@Entity
@Table(name = "USER_ROLE", catalog = "rdv")
public class UserRole implements java.io.Serializable {

	private Integer userRoleId;
	private User user;
	private String roleCode;
	private Date dtCreate;
	private Date dtModif;
	private Date dtEnd;

	public UserRole() {
	}

	public UserRole(String roleCode) {
		this.roleCode = roleCode;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "USER_ROLE_ID", unique = true, nullable = false)
	public Integer getUserRoleId() {
		return this.userRoleId;
	}

	public void setUserRoleId(Integer userRoleId) {
		this.userRoleId = userRoleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "USER_ID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Column(name = "ROLE_CODE", nullable = false, length = HibernateConstant.LENGTH.ROLE_CODE)
	public String getRoleCode() {
		return this.roleCode;
	}

	public void setRoleCode(String roleCode) {
		this.roleCode = roleCode;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_CREATE", length = HibernateConstant.LENGTH.DATETIME)
	public Date getDtCreate() {
		return this.dtCreate;
	}

	public void setDtCreate(Date dtCreate) {
		this.dtCreate = dtCreate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_MODIF", length = HibernateConstant.LENGTH.DATETIME)
	public Date getDtModif() {
		return this.dtModif;
	}

	public void setDtModif(Date dtModif) {
		this.dtModif = dtModif;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "DT_END", length = HibernateConstant.LENGTH.DATETIME)
	public Date getDtEnd() {
		return this.dtEnd;
	}

	public void setDtEnd(Date dtEnd) {
		this.dtEnd = dtEnd;
	}

}
